NAND flash memory, as well as other types of non-volatile memories (“NVMs”), are commonly used for mass storage. For example, consumer electronics such as portable media players often include flash memory to store music, videos, and other media.
A NVM may include both data that is needed by an electronic device (e.g., “valid data”) and data that is no longer needed by the electronic device (e.g., “invalid data”). Valid data stored in a NVM can further be separated into data that is frequently updated or changed (e.g., “dynamic data”) and data that is rarely updated or changed (e.g., “static data”). Conventionally, the placement of data in the NVM is rather arbitrary, such that there may be a mixture of dynamic and static data stored in a single block of the NVM.
Some NVMs are configured such that a block of programmed memory locations needs to be erased before any of the memory locations in the block can be reprogrammed. Therefore, electronic devices typically perform an operation referred to as “garbage collection” (“GC”) to free up blocks for erasing and reprogramming. To free up all of the memory locations in that block for erasing, the electronic device may copy the block's valid data into memory locations of another block. Because there is a mixture of dynamic and static data on a block, the efficiency of GC can be low because the amount of valid data that has to be copied may be significant.
In addition, electronic devices may sometimes perform GC on a block using an operation referred to as “wear leveling”. Wear leveling is generally used to extend the useful life of the NVM. Oftentimes, systems may perform unnecessary wear leveling of the NVM, which may in fact result in more wear of the NVM.